package main

import (
	"gitee.com/dhcy/video_demo/controller"
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.GET("ping", func(c *gin.Context) {
		c.String(http.StatusOK, "%s", "pong")
	})
	vc := controller.NewVideoController()
	videosGroup := r.Group("videos")
	{
		videosGroup.GET("/", vc.GetAll)
		videosGroup.POST("/", vc.Create)
		videosGroup.PUT("/:id", vc.Update)
		videosGroup.DELETE("/:id", vc.Delete)
	}

	r.Run(":8080")
}
